/*
 * File:   hfile.h
 * Author: roy, gino, kevin ouwens
 *
 * Created on December 15, 2010, 4:33 AM
 */

#include <semaphore.h>
#ifndef HFILE_H
#define	HFILE_H

#ifdef	__cplusplus
extern "C" {
#endif


#ifdef	__cplusplus
}
#endif

#endif	/* HFILE_H */

#define FILEPATH_COMMCHAN "/tmp/commchan.bin"

#define ACC_RIGHT 0600

#define CMDSIZE 50
#define ARGSIZE CHUNKSIZE - CMDSIZE
#define CHUNKSIZE 1460

//this is the struct where clients store their data.
//this struct is still a WIP and will be expanded with more unique data's per client
typedef struct{
    int clientNo;
    int iMapFd;
    int iFileFd;
    int iCount, i, n;
    long unsigned luFileSize;
    long unsigned amountRead;
    long unsigned amountWritten;
    long unsigned totalSent;
    char *cMapFile;
    char tempBuff[CHUNKSIZE];
    char *cMemMapPath;
    char *cCurrentDir;
    char filename[ARGSIZE];
    char command[CMDSIZE];
    sem_t *semaphoreFull;
    sem_t *semaphoreEmpty;
}clientInfo;
